<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> UDT Reference</title>
<link rel="stylesheet" href="udtdoc.css" type="text/css" />
</head>

<body>
<div class="ref_head">&nbsp;UDT Reference: Functions</div>

<h4 class="func_name"><strong>perfmon</strong></h4>
<p>The <b>perfmon</b> method retrieves the internal protocol parameters and performance trace.</p>

<div class="code">int perfmon(<br />
&nbsp; UDTSOCKET <font color="#FFFFFF">u</font>,<br />
&nbsp; TRACEINFO* <font color="#FFFFFF">perf</font>,<br />
&nbsp; bool <font color="#FFFFFF">clear</font> = true<br />
);</div>

<h5>Parameters</h5>
<dl>
  <dt><i>u</i></dt>
  <dd>[in] Descriptor identifying a UDT entity.</dd>
  <dt><i>trace</i></dt>
  <dd>[out] Pointer to the <a href="structure.htm">TRACEINFO</a> structure to store the performance information.</dd>
  <dt><i>clear</i></dt>
  <dd>[in] Flag that indicates if the local traces should be cleared and counts should be restarted.</dd>
</dl>

<h5>Return Value</h5>
<p>If success, 0 is returned and trace information is written into <i>trace</i>; otherwise, UDT::ERROR is returned and specific error information can be retrieved by <a 
href="error.htm">getlasterror</a>.</p>

<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
  <tr>
    <td width="17%" class="table_headline"><strong>Error Name</strong></td>
    <td width="17%" class="table_headline"><strong>Error Code</strong></td>
    <td width="83%" class="table_headline"><strong>Comment</strong></td>
  </tr>
  <tr>
    <td>ECONNLOST</td>
    <td>2001</td>
    <td>connection is broken.</td>
  </tr>
  <tr>
    <td>EINVSOCK</td>
    <td>5004</td>
    <td><i>u</i> is an invalid socket.</td>
  </tr>
  <tr>
    <td>EUNBOUNDSOCK</td>
    <td>5005</td>
    <td><i>u</i> is not connected.</td>
  </tr>
</table>

<h5>Description</h5>
<p>The <strong>perfmon</strong> method reads the performance data since the last time <strong>perfmon</strong> is executed, or since the connection is started. The result in written into a <a href="structure.htm">TRACEINFO</a> structure.</p>
<p>There are three kinds of performance information that can be read by applications: the total counts since the connection is started, the periodical counts since last time the counts are cleared, and instant parameter values.<p>

</body>
</html>
